package javabasics.concurrent.guardedsuspension;

import javax.xml.crypto.Data;

/**
 * @Author suxiaoxiao
 * @Date 2019/6/16 13:35
 * @Version 1.0
 */
public class Request {

    private String name;
    /**
     * 请求的返回值
     * 参考 Future 模式中的实现
     */
    private Data response;

    public Request(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public synchronized Data getResponse() {
        return response;
    }

    public synchronized void setResponse(Data response) {
        this.response = response;
    }

    @Override
    public String toString() {
        return "Request{" +
                "name='" + name + '\'' +
                '}';
    }

}
